%xelatex chapter01.tex
\documentclass[12pt,openany]{ctexbook}
\ctexset{section={format={\Large\bfseries}}}
\usepackage{graphicx} %排版jpg/png图
\usepackage{ctex} %中文排版
\usepackage{arydshln} %负责画虚线的包
\usepackage{listings} %代码排版
\usepackage{xcolor}
%水印设置
\usepackage{tikz}
\AddToHook{shipout/foreground}{
  \begin{tikzpicture}[remember picture,overlay]
    \node[red,rotate=45,scale=4,opacity=0.1] at (current page.center) {少儿用游戏学C语言编程}; 
  \end{tikzpicture}
}
%C++源代码风格定义
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2,
    frame=single
}
%C++源代码风格设置
\lstset{style=mystyle}

\begin{document}

%---------------------------------- 
\author{李成义\thanks{QQ：83619509,Email:83619509@qq.com}\\昆明广播电视大学}
\title{少儿用游戏学C语言编程}

%产生标题
\maketitle
%\makeindex
% 设置页眉、页脚
%产生目录----------------------
\tableofcontents
%重新计数页码-------------------

%\thanks{all world and myself!}
%\frontmatter

\include{chapter-preface}
\include{chapter01/chapter01}
\include{chapter02/chapter02}
\include{grammar/grammar}
\include{speaking/speaking}
\include{dohomework/dohomework}
\include{remainder/remainder}
\include{dowhat/dowhat}
\include{onecircle/onecircle}
\include{screen/screen}
\end{document}